<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>个人中心</title>
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<link href="/carworld_weixin/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="/carworld_weixin/css/user-style.css" rel="stylesheet">
<script src="/carworld_weixin/js/jquery-3.3.1.min.js"></script>
<script src="/carworld_weixin/js/bootstrap.min.js"></script>
<style type="text/css">
.tb960x90 {
	display: none !important;
	display: none
}
.bgtomood {background:url(../images/moodbgQr.jpg);}
</style>
</head>
<body>
	<section class="aui-flexView">
		<section class="aui-scrollView">
			<div class="aui-centers-box" style="height: 155px">
				<div class="aui-head-title">
					<h2 style="padding-top: 7px"></h2>
					<div class="aui-flex" style="padding: 7px">
						<div class="aui-flex-pu">
							<em>
								<i class="icon icon-vip"></i>
								钻石会员
							</em>
						</div>
						<div class="aui-flex-box">
							<p id="member-info"></p>
						</div>
					</div>
				</div>
				<!--  因为目前没有编辑需求，所以去掉--Bsea
				<div class="aui-edit-btn">
					<a href="javascript:;">
						<i class="icon icon-edit"></i>
					</a>
				</div>
				-->
				<div class="aui-flex aui-flex-top" style="padding: 7px">
					<div class="aui-img-logo">
						<img src="" alt="" id="user-photo">
					</div>
					<div class="aui-flex-box">
						<!--<span class="aui-flex-box-item">-->
							<!--<p>套餐</p>-->
							<!--<p class="aui-bod" id="mealNum"></p>-->
						<!--</span>-->
						<span class="aui-flex-box-item">
							<p style="color: orange">积分</p>
							<p style="color: orange" class="aui-bod" id="jifen"></p>
						</span>
						<span class="aui-flex-box-item">
							<p style="color: orange">充值余额</p>
							<p style="color: orange" class="aui-bod" id="balance"></p>
						</span>
						<span class="aui-flex-box-item">
							<p style="color: orange">会员号</p>
							<p style="color: orange" class="aui-bod" id="canum"></p>
						</span>
					</div>
				</div>
			</div>
			<div class="aui-flex" style="padding: 7px">
				<!--<div class="aui-flex-box">-->
					<!--<h2>我的订单</h2>-->
				<!--</div>-->
				<!--<div class="aui-flex-box-all">-->
					<!--<a href="/carworld_weixin/pages/page_myOrder.html">查看全部</a>-->
				<!--</div>-->
			</div>

			<div class="aui-centers-ad" style="padding: 7px">
				<div class="aui-centers-img">
					<img src="/carworld_weixin/images/user-banner.jpg" alt="">
				</div>
			</div>
			<div class="aui-palace" style="padding: 0px">
				<!-- 第一个 -->
				<a href="/carworld_weixin/pages/page_userCard/myAllMeals.html" class="aui-palace-grid">
					<div class="aui-palace-grid-icon">
						<img src="/carworld_weixin/images/icon-png/icon-item-006.png" alt="">
					</div>
					<div class="aui-palace-grid-text">
						<h2>我的卡包</h2>
						<p>查看会员卡套餐</p>
					</div>
				</a>
				<a href="/carworld_weixin/dividend/teamls" class="aui-palace-grid">
					<div class="aui-palace-grid-icon">
						<img src="/carworld_weixin/images/icon-png/icon-item-002.png" alt="">
					</div>
					<div class="aui-palace-grid-text">
						<h2>人脉会员</h2>
						<p>我介绍的客户</p>
					</div>
				</a>
				<a href="/carworld_weixin/dividend/returndividendIndex" class="aui-palace-grid">
					<div class="aui-palace-grid-icon">
						<img src="/carworld_weixin/images/icon-png/icon-item-004.png" alt="">
					</div>
					<div class="aui-palace-grid-text">
						<h2>分红收益</h2>
						<p>查看分红明细</p>
					</div>
				</a>
				<a href="/carworld_weixin/withdraw/takeCashPage" class="aui-palace-grid">
					<div class="aui-palace-grid-icon">
						<img src="/carworld_weixin/images/icon-png/icon-item-003.png" alt="">
					</div>
					<div class="aui-palace-grid-text">
						<h2>提现申请</h2>
						<p>分红余额提现</p>
					</div>
				</a>
				<a href="javascript:alert('请拨打门店电话：(02)89580828')" class="aui-palace-grid">
					<div class="aui-palace-grid-icon">
						<img src="/carworld_weixin/images/icon-png/icon-item-005.png" alt="">
					</div>
					<div class="aui-palace-grid-text">
						<h2>在线客服</h2>
						<p>24小时服务</p>
					</div>
				</a>
			</div>
			<div class="aui-button-btn">
				<a style="background-color: #5bc0de" href="javascript:;" data-toggle="modal" data-target="#invitation_code" id="loadQR">我要分享邀请码赚钱</a>
			</div>
			<footer class="aui-footer aui-footer-fixed">
				<a href="/carworld_weixin/" class="aui-tabBar-item">
					<span class="aui-tabBar-item-icon">
						<i class="glyphicon glyphicon-home"></i>
					</span>
					<span class="aui-tabBar-item-text">首页</span></span><span class="aui-tabBar-item-text">home</span>

				</a>
				<a href="/carworld_weixin/pages/page_userCard/myVipCard.html" class="aui-tabBar-item ">
					<span class="aui-tabBar-item-icon">
						<i class="glyphicon glyphicon-heart"></i>
					</span>
					<span class="aui-tabBar-item-text">会员卡</span></span><span class="aui-tabBar-item-text">vip card</span>

				</a>
				<a href="/carworld_weixin/pages/page_userOrder/myOrder.html" class="aui-tabBar-item ">
					<span class="aui-tabBar-item-icon">
						<i class="glyphicon glyphicon-tasks"></i>
					</span>
					<span class="aui-tabBar-item-text">订单</span></span><span class="aui-tabBar-item-text">order</span>

				</a>
				<a href="/carworld_weixin/user/userPage" class="aui-tabBar-item">
					<span class="aui-tabBar-item-icon">
						<i class="glyphicon glyphicon-user"></i>
					</span>
					<span class="aui-tabBar-item-text">我的</span></span><span class="aui-tabBar-item-text">mine</span>

				</a>
			</footer>
		</section>
	</section>
	<!-- 弹出邀请码模态框 -->
	<div class="modal fade" id="invitation_code" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">长按分享专属邀请二维码</h4>
				</div>
				<div id="qrcodeCanvas" style="display: none;"></div>
				<div class="modal-body bgtomood" style="text-align: center;background-size: 100% 100%;height: 400px" >
					<img style="margin-top: 71px" id="image" />
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
	<script>

	$(function() {
        $.ajax({
            type: 'GET',
            url: '/carworld_weixin/vipcard/getCardInfo',
            success: function(data) {
                if (null == data.card) {
                    $('#balance').text('￥0');
                } else {
                    $('#balance').text('￥' + data.card.amt);
                }
            }
            });

	    $.ajax({
	        type: 'GET',
	        url: '/carworld_weixin/user/getUserInfo',
	        dataType: 'json',
	        contentType: 'application/json',
	        success: function(data) {
	            console.log(data);
	            $('h2:first').text(data.user.user_nickname);
	            $('#user-photo').attr("src", data.user.user_photo);
                if(null==data.user.score){
                    $('#jifen').text('0分');
                }else {
                    $('#jifen').text(data.user.score+'分');
                }
                $('#canum').text(data.user.mobile);
	            if (null != data.shop) {
	                if (data.user.user_isVerificated == 1) {
	                    $('#member-info').text('已通过【' + data.shop.name + '】会员验证');
	                } else {
	                    $('#member-info').text('会员信息未验证，请与门店联系~');
	                }
	            }

	            //生成二维码
	            $('#loadQR').click(function() {
	                $("image").removeAttr("src");
	                jQuery('#qrcodeCanvas').qrcode({
	                    text: "http://food.3kkk.xyz/carworld_weixin/user/bindMember?shareBy=" + data.user.id + "&status=bindMember",
	                    width: "180",
	                    height: "180",
	                    background: "#ffffff",
	                    foreground: "#000000",
	                });
	                var canvas = document.getElementsByTagName('canvas')[0];
	                var image = new Image();
	                image.src = canvas.toDataURL("image/jpeg");
	                $('#image').attr("src", image.src);
	            })
	        }
	    });

	});
	</script>
	<script type="text/javascript" src="/carworld_weixin/js/qr-js/jquery.qrcode.js"></script>
	<script type="text/javascript" src="/carworld_weixin/js/qr-js/qrcode.js"></script>
	<script type="text/javascript" src="/carworld_weixin/js/qr-js/utf.js"></script>
</body>
</html>